package com.right.health.app.ui.me.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.magic.basic.adapter.BaseAbsAdapter;
import com.right.health.app.R;

/*
 * Created by hopeliao on 2019-11-23
 *
 */
public class CycleTimeBottomAdapter extends BaseAbsAdapter<CycleTimeBottomAdapter.ReminderAddBottomInfo> {

    public CycleTimeBottomAdapter(Context context) {
        super(context);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHolder = null;
        if(convertView == null) {
            viewHolder = new ViewHolder();

            convertView = mInflater.inflate(R.layout.dialog_reminder_add_cycle_dialog, null);
            viewHolder.nameTv = (TextView) convertView.findViewById(R.id.tv_name);
            viewHolder.timeTv = (TextView) convertView.findViewById(R.id.tv_time);
            convertView.setTag(viewHolder);

        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        ReminderAddBottomInfo info = mDataSource.get(position);

        viewHolder.timeTv.setText(info.time);
        viewHolder.nameTv.setText(info.name);
        return convertView;
    }

    private class ViewHolder {
        TextView nameTv;
        TextView timeTv;
    }

    public static class ReminderAddBottomInfo {
        public String name;
        public String time;
        public int chooseHour, chooseMinute;
    }
}
